package com.api.shopapi.mapper;

import com.api.shopapi.entity.NursingSchedulingNoon;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface NursingSchedulingNoonMapper {

    @Insert("insert into  nursing_scheduling_noon " +
            "(NursingSchedulingNoonCode,NursingSchedulingCode) " +
            "values (#{nursingSchedulingNoon.NursingSchedulingNoonCode} ,#{nursingSchedulingNoon.NursingSchedulingCode} )")
    int insert(@Param("nursingSchedulingNoon") NursingSchedulingNoon nursingSchedulingNoon);

    @Update("update nursing_scheduling_noon set NursingSchedulingCode=#{nursingSchedulingNoon.NursingSchedulingCode} where NursingSchedulingNoonCode=#{nursingSchedulingNoon.NursingSchedulingNoonCode}   ")
    int updateByNursingSchedulingNoonCode(@Param("nursingSchedulingNoon") NursingSchedulingNoon nursingSchedulingNoon);

    @Delete("delete from nursing_scheduling_noon where nursingSchedulingNoonCode=#{nursingSchedulingNoonCode} ")
    int deleteByNursingSchedulingNoonCode(@Param("nursingSchedulingNoonCode")String nursingSchedulingNoonCode);

    @Select("select * from nursing_scheduling_noon where NursingSchedulingNoonCode=#{nursingSchedulingNoonCode} limit 1")
    NursingSchedulingNoon getByNursingSchedulingNoonCode(@Param("nursingSchedulingNoonCode")String nursingSchedulingNoonCode);

    @Select("select * from nursing_scheduling_noon where NursingSchedulingCode=#{nursingSchedulingCode} limit 1")
    NursingSchedulingNoon getByNursingSchedulingCode(@Param("nursingSchedulingCode") String nursingSchedulingCode);
}
